package com.example.mybatisplus.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.mybatisplus.common.JsonResponse;
import com.example.mybatisplus.model.domain.Goods;
import com.example.mybatisplus.mapper.GoodsMapper;
import com.example.mybatisplus.model.dto.PageDTO;
import com.example.mybatisplus.service.GoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lj
 * @since 2024-06-27
 */
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {

    @Override
    public JsonResponse pageList(Goods goods, PageDTO pageDTO) {
        Page<Goods> page = new Page<>(pageDTO.getPageNum(), pageDTO.getPageSize());
        Page<Goods> pageList = baseMapper.pageList(page,goods);
        return JsonResponse.success(pageList);
    }
}
